import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

class Student implements Comparable<Student>{
    private String name ;
    private int age ;
    private float score ;

    public Student(String name, Integer age, Float score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return (int)(this.score-o.score);
    }
}
public class Test {
    public static void main(String[] args) {
        ArrayList<Student> arrayList = new ArrayList<>(3);
        arrayList.add(new Student("yzh", 10, 92.0f));
        arrayList.add(new Student("yzh2", 11, 93.0f));
        arrayList.add(new Student("yzh3", 12, 94.0f));

        Collections.sort(arrayList);
    }
}

